/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package irsystem.scenario.method;

import java.util.HashMap;
import java.util.List;

/**
 *
 * @author Cerulean
 */
public class BinaryTF extends TermFrequency {

    public BinaryTF(List<String> terms) {
        super(terms);
    }

    @Override
    public TermVectorSpace process() {
        TermVectorSpace tfVector = new TermVectorSpace(new HashMap<String, Double>());
        for (String term : terms) {
            if (!tfVector.isTermExist(term)) {
                tfVector.addValue(term, 1);
            }
        }
        return tfVector;
    }
}
